package com.qq.weixin.model.tpl;

import java.util.HashMap;
import java.util.Map;

public class TemplateSendMsg {
	private String touser;
	private String template_id;
	private String url;
	private String topcolor;
	private Map<String, DataValue> data;

	public static TemplateSendMsg create() {
		TemplateSendMsg templateSendMsg = new TemplateSendMsg();
		templateSendMsg
				.setData(new HashMap<String, TemplateSendMsg.DataValue>());
		return templateSendMsg;
	}

	public static TemplateSendMsg create(String template_id, String url,
			String topcolor) {
		TemplateSendMsg templateSendMsg = new TemplateSendMsg();
		templateSendMsg.template_id = template_id;
		templateSendMsg.url = url;
		templateSendMsg.topcolor = topcolor;
		templateSendMsg.data = new HashMap<String, TemplateSendMsg.DataValue>();
		return templateSendMsg;
	}

	public static DataValue createDataValue(String value, String color) {
		DataValue dataValue = new DataValue();
		dataValue.setValue(value);
		dataValue.setColor(color);
		return dataValue;
	}

	public void putDataValue(String key, DataValue dataValue) {
		if (data == null) {
			data = new HashMap<String, DataValue>();
		}
		data.put(key, dataValue);
	}

	public String getTouser() {
		return touser;
	}

	public void setTouser(String touser) {
		this.touser = touser;
	}

	public String getTemplate_id() {
		return template_id;
	}

	public void setTemplate_id(String template_id) {
		this.template_id = template_id;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getTopcolor() {
		return topcolor;
	}

	public void setTopcolor(String topcolor) {
		this.topcolor = topcolor;
	}

	public Map<String, DataValue> getData() {
		return data;
	}

	public void setData(Map<String, DataValue> data) {
		this.data = data;
	}

	public static class DataValue {
		private String value;
		private String color;

		public String getValue() {
			return value;
		}

		public void setValue(String value) {
			this.value = value;
		}

		public String getColor() {
			return color;
		}

		public void setColor(String color) {
			this.color = color;
		}

	}
}
